const app = getApp()
Component({
  mixins: [],
  data: {
     firstClick: true,
  },
  props: {
    openIfmemberpop: false,
    showConsume: false,
    consumeTxt: '',
    href: '',
    onClose: (e) => console.log('1'),
  },
  methods: {
    onModalClose22() {
      this.setData({
        'truePaw': '',
        'paw': ''
      })
      this.props.onClose()
    },
    toPage(e) {
      // if (this.data.firstClick) {
      //   this.data.firstClick = false
      // } else {
      //   return
      // }
      var url = e.currentTarget.dataset.url
      if (url == '直接查看') {
        url = '/pages/order/myOrder/myOrder'
      } else if (url == '直接消费') {
        // my.alert({
        //   title: '很抱歉',
        //   content: '该功能暂未开通，敬请期待~',
        //   buttonText: '我知道了',
        // });
        // return
        url = '/pages/oil/oilIndex/oilIndex'
      }
      this.props.onClose()
      console.log(this.props.href)
      if (this.props.href) {
        if (this.props.href == 'oilResult') {
          my.redirectTo({
            url: url + '?href=oilResult',
          })
        } else if (this.props.href == 'oilConfirm') {
          my.navigateTo({
            url: url + '?href=oilConfirm'
          })
        }
      } else {
        my.navigateTo({
          url: url
        })
      }
    }
  },
});